<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>Set&Map</h2>
</body>
<script src="a.js"></script>
<script src="b.js"></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<script>
   // const s1=new Set()
   
    // s1.add(10)
    // s1.add(20)
    // s1.add('vue')
 //   s1.add('React')
    //s1.delete(20)
   // s1.clear()
//    console.log(s1.has('vue.js'))
    //console.log(s1.size)
    // s1.forEach((item,index)=>{
    //     console.log(item)
    //     console.log('index:',index)
    // })

   // console.log(s1.entries())

    // for(let item of s1.entries()) {
    //     console.log('item:',item)
    // }


   // const arr=[3,4,23,23,23,23,2,2,2,4,5,56]

    //利用new set数组去重
   // console.log([...new Set(arr)])

   //Map使用
   const m1=new Map()
   
   let s1=Symbol('hello')
   let n1=null;
   m1.set('name','张三')
   m1.set('age',20)
   m1.set('address','北京')
   m1.set(s1,'aalalaldfkafd')
   m1.set(n1,'我是空的')
  // m1.delete('address')
   //m1.clear()
  // console.log(m1)
   //console.log(m1.has('name'))
  // console.log(m1.get('name'))
  // console.log(m1.size)

//   m1.forEach((item,key)=>{
//     console.log(item)
//     console.log('key:',key)
//   })

for(let [key,value] of m1.entries()) {
    console.log('key:',typeof key)
    console.log('value:',value)
}

// console.log(obj1)
// for(let key in obj1) {
//     console.log(typeof key)
// }
</script>
</html>